|
|
|
|
|
|
|
Now, add the code from Listing 11.8 to the Form_Resize event. This code allows users to resize the graph by resizing the form. |
|
|
|
|
|
|
|
|
Listing 11.8. Adding code to the Form_Resize event. |
|
|
|
|
|
|
|
|
Private Sub Form_Resize()
'
' make graph fill the form
'
Graph1.Left = 1
Graph1.Top = 1
Graph1.Width = Me.ScaleWidth
Graph1.Height = Me.ScaleHeight
'
End Sub |
|
|
|
|
|
|
|
|
The code in Listing 11.9 goes in the mnuFileItem_Click event. This code is executed each time the user selects one of the File menu items. The Index value returns the item number selected by the user. You code the CopyGraph and SaveGraph methods in just a moment. |
|
|
|
|
|
|
|
|
Listing 11.9. Coding the mnuFileItem_Click event. |
|
|
|
|
|
|
|
|
Private Sub mnuFileItem_Click(Index As Integer)
'
' handle file menu selections
'
Select Case Index
Case 0 ' save
GraphSave
Case 1 ' copy
GraphCopy
Case 2 ' separator
' no action
Case 3 ' print
Me.PrintForm
Case 4 ' printer setup
CommonDialog1.ShowPrinter
Case 5 ' separator
' no action
Case 6 ' exit
Unload Me
End Select
'
End Sub |
|
|
|
|
|